<!-- 签到组件 -->
<template>
  <div class="signin-container" @click="onCheckIn(props.SigninData.id)">
    <div class="main">
      <div class="title">
        <p class="topText">{{ props.SigninData.title }}</p>
        <p class="text">{{ props.SigninData.text1 }}</p>
        <p class="text">{{ props.SigninData.text2 }}</p>
      </div>
      <div class="fun" :class="{ gray: props.SigninData.isSignIn }">
        <p class="topText">{{ props.SigninData.funText }}</p>
        <p class="time">{{ time }}</p>
      </div>
    </div>
  </div>
</template>

<script setup>
import moment from "moment";
// 获取当前日期 年-月-日
const time = moment().format("YYYY-MM-DD");
const props = defineProps({
  SigninData: {
    type: Object,
    required: true,
  },
});
const emit = defineEmits(["onCheckIn"]);
function onCheckIn(id) {
  if(props.SigninData.isSignIn){
    return
  }
  emit("onCheckIn", id);
}
</script>

<style lang="less" scoped>
@import "@/styles/var.less";
@import "@/styles/mixin.less";
.signin-container {
  width: 100%;
  height: 100%;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  .main {
    width: 100%;
    height: 100%;
    background-color: @bakeground;
    backdrop-filter: blur(5px);
    box-shadow: 2px 2px 20px #626262;
    width: 100%;
    height: 50%;
    display: flex;
    justify-content: space-around;
    align-items: center;
    text-align: center;
    .title,
    .fun {
      height: 100%;
      position: relative;
      flex-direction: column;
      display: flex;
      justify-content: center;
      p {
        margin: 10px 0;
      }
      .topText {
        font-size: 40px;
        font-weight: bold;
      }
    }
    .title {
      text-align: left;
      .topText {
        font-size: 40px;
        font-weight: bold;
        text-align: left;
      }
      .text {
        font-size: 20px;
        color: gray;
      }
    }
    .fun {
      cursor: pointer;
      width: 250px;
      height: 250px;
      border-radius: 50%;
      background: linear-gradient(45deg, @frameColor1, @frameColor2);
      text-shadow: 2px 2px 10px #3b3b3b;
      &.gray {
        background: @gray;
        text-shadow: none;
        cursor: no-drop;
      }
    }
  }
}
</style>